package com.atguigu.gmall.product.client;

import com.atguigu.gmall.model.product.*;
import com.atguigu.gmall.product.client.impl.ProductDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 * @create 2020-05-15 18:31
 */
@FeignClient(name ="service-product", fallback = ProductDegradeFeignClient.class)
public interface ProductFeignClient {

   //根据skuId查询SkuInfo
    @GetMapping("/api/product/inner/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);
    //
    @GetMapping("/api/product/inner/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable("category3Id") Long category3Id);
    //3.
    @GetMapping("/api/product/inner/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable(value = "skuId") Long skuId);
    //4.
    @GetMapping("/api/product/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
    public List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable("skuId") Long skuId, @PathVariable("spuId") Long spuId);
    //5.
    @GetMapping("/api/product/inner/getSkuValueIdsMap/{spuId}")
    public Map getSkuValueIdsMap(@PathVariable("spuId") Long spuId);


    //根据一二三级id查询数据生成静态化页面
    @GetMapping("/api/product/inner/getBaseCategoryMap")
    public List<Map> getBaseCategoryMap();

    //根据品牌id查询品牌信息
    @GetMapping("/api/product/inner/getBaseTrademark")
    public BaseTrademark getBaseTrademark(@PathVariable(name ="tmId")Long tmId);

    //根据SkuId查询平台属性id/名称 平台属性值的名称
    @GetMapping("/api/product/inner/getAttrList/{skuId}")
    public List<SkuAttrValue> getAttrList(@PathVariable(name = "skuId") Long skuId);

}